import 'package:flutter/material.dart';
class LoaddingWidget extends StatefulWidget {
  bool hasMore = false;
  LoaddingWidget({Key key,this.hasMore}) : super(key: key);
  _LoaddingWidgetState createState() => _LoaddingWidgetState();
}
class _LoaddingWidgetState extends State<LoaddingWidget> {
  @override
  Widget build(BuildContext context) {
    if(widget.hasMore){
      return Center(
        child: Padding(
          padding: EdgeInsets.all(10.0),
          child: Row(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: <Widget>[
              Text(
                '加载中...',
                style: TextStyle(fontSize: 16.0),
              ),
              Container(
                margin: EdgeInsets.only(left:20),
                width: 18,
                height: 18,
                child: CircularProgressIndicator(
                  strokeWidth: 2.0,
                ),
              )
            ],
          ),
        ),
      );
    }else if(!widget.hasMore){
       return Center(
         child: Padding(
           padding: EdgeInsets.all(10.0),
           child: Text("--我是有底线的--"),
         ),
       );
    }
  }
}
